/*     */ package cn.com.hongpay.client.gen;
/*     */ 
/*     */ import cn.com.hongpay.client.utils.Md5Encoder;
/*     */ import cn.com.hongpay.client.vo.bind.BindVo;
/*     */ import cn.com.hongpay.client.vo.pay.SinglePayNotifyResVo;
/*     */ import cn.com.hongpay.client.vo.pay.SinglePayVo;
/*     */ import cn.com.hongpay.client.vo.query.QueryVo;
/*     */ import cn.com.hongpay.client.vo.refund.RefundVo;
/*     */ import java.text.SimpleDateFormat;
/*     */ 
/*     */ public class XmlGenerate
/*     */ {
/*     */   protected String getPayXml(SinglePayVo payVo)
/*     */     throws Exception
/*     */   {
/*  21 */     SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/*  22 */     String requestTime = df.format(payVo.getRequestTime());
/*  23 */     String tradeTime = df.format(payVo.getTradeTime());
/*  24 */     String partnerVerifyCode = Md5Encoder.encode(payVo.getPartnerVerifyCode() + requestTime);
/*     */ 
/*  26 */     String payXmlSource = 
/*  27 */       "<?xml version=\"1.0\" encoding=\"UTF-8\"?><AIPAYTRADE><INFO><SERVICE_TYPE>" + 
/*  30 */       payVo.getServiceType() + "</SERVICE_TYPE>" + 
/*  31 */       "<CLIENT_IP>" + payVo.getClientIp() + "</CLIENT_IP>" + 
/*  32 */       "<PARTNER_ID>" + payVo.getPartnerId() + "</PARTNER_ID>" + 
/*  33 */       "<PARTNER_VERIFY_CODE>" + partnerVerifyCode + "</PARTNER_VERIFY_CODE>" + 
/*  34 */       "<REQUEST_TIME>" + requestTime + "</REQUEST_TIME>" + 
/*  35 */       "<SIGNED_MSG></SIGNED_MSG>" + 
/*  36 */       "</INFO>" + 
/*  37 */       "<BODY>" + 
/*  38 */       "<TRANS_SUM>" + 
/*  39 */       "<PAYER_PARTNER_ACCT_ID>" + payVo.getPayerPartnerAcctId() + "</PAYER_PARTNER_ACCT_ID>" + 
/*  40 */       "<PAYER_PARTNER_ACCT_NAME>" + payVo.getPayerPartnerAcctName() + "</PAYER_PARTNER_ACCT_NAME>" + 
/*  41 */       "<TRADE_TIME>" + tradeTime + "</TRADE_TIME>" + 
/*  42 */       "<TOTAL_AMOUNT>" + payVo.getTotalAmount() + "</TOTAL_AMOUNT>" + 
/*  43 */       "<TOTAL_RECORD>" + payVo.getTotalRecord() + "</TOTAL_RECORD>" + 
/*  44 */       "<RETURN_URL>" + payVo.getReturnUrl() + "</RETURN_URL>" + 
/*  45 */       "<NOTIFY_URL>" + payVo.getNotifyUrl() + "</NOTIFY_URL>" + 
/*  46 */       "<ACCT_RESERVED_FIELD1>" + payVo.getAcctReservedField1() + "</ACCT_RESERVED_FIELD1>" + 
/*  47 */       "<ACCT_RESERVED_FIELD2>" + payVo.getAcctReservedField2() + "</ACCT_RESERVED_FIELD2>" + 
/*  48 */       "<ACCT_RESERVED_FIELD3>" + payVo.getAcctReservedField3() + "</ACCT_RESERVED_FIELD3>" + 
/*  49 */       "<TRADE_REMARK>" + payVo.getTradeRemark() + "</TRADE_REMARK>" + 
/*  50 */       "</TRANS_SUM>" + 
/*  51 */       "<TRADE_DETAILS>" + 
/*  52 */       "<TRANS_DETAIL>" + 
/*  53 */       "<PARTNER_TRADE_NO>" + payVo.getPartnerTradeNo() + "</PARTNER_TRADE_NO>" + 
/*  54 */       "<PAY_AMOUNT>" + payVo.getPayAmount() + "</PAY_AMOUNT>" + 
/*  55 */       "<PAYEE_PARTNER_ACCT_ID>" + payVo.getPayeePartnerAcctId() + "</PAYEE_PARTNER_ACCT_ID>" + 
/*  56 */       "<PAYEE_PARTNER_ACCT_NAME>" + payVo.getPayeePartnerAcctName() + "</PAYEE_PARTNER_ACCT_NAME>" + 
/*  57 */       "<PAYEE_CARD_TYPE>" + payVo.getPayeeCardType() + "</PAYEE_CARD_TYPE>" + 
/*  58 */       "<PAYEE_CARD_NO>" + payVo.getPayeeCardNo() + "</PAYEE_CARD_NO>" + 
/*  59 */       "<PAYEE_BANK_CODE>" + payVo.getPayeeBankCode() + "</PAYEE_BANK_CODE>" + 
/*  60 */       "<PAYEE_CARD_NAME>" + payVo.getPayeeCardName() + "</PAYEE_CARD_NAME>" + 
/*  61 */       "<PAYEE_CERT_TYPE>" + payVo.getPayeeCertType() + "</PAYEE_CERT_TYPE>" + 
/*  62 */       "<PAYEE_CERT_CODE>" + payVo.getPayeeCertCode() + "</PAYEE_CERT_CODE>" + 
/*  63 */       "<TRADE_RESERVED_FIELD1>" + payVo.getTradeReservedField1() + "</TRADE_RESERVED_FIELD1>" + 
/*  64 */       "<TRADE_RESERVED_FIELD2>" + payVo.getTradeReservedField2() + "</TRADE_RESERVED_FIELD2>" + 
/*  65 */       "<TRADE_RESERVED_FIELD3>" + payVo.getTradeReservedField3() + "</TRADE_RESERVED_FIELD3>" + 
/*  66 */       "<TRADE_RESERVED_FIELD4>" + payVo.getTradeReservedField4() + "</TRADE_RESERVED_FIELD4>" + 
/*  67 */       "<TRADE_RESERVED_FIELD5>" + payVo.getTradeReservedField5() + "</TRADE_RESERVED_FIELD5>" + 
/*  68 */       "<DETAIL_REMARK>" + payVo.getDetailRemark() + "</DETAIL_REMARK>" + 
/*  69 */       "</TRANS_DETAIL>" + 
/*  70 */       "</TRADE_DETAILS>" + 
/*  71 */       "</BODY>" + 
/*  72 */       "</AIPAYTRADE>";
/*     */ 
/*  75 */     return payXmlSource;
/*     */   }
/*     */ 
/*     */   protected String getQueryXml(QueryVo queryVo)
/*     */     throws Exception
/*     */   {
/*  84 */     SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/*     */ 
/*  86 */     String requestTime = df.format(queryVo.getRequestTime());
/*  87 */     String queryTime = df.format(queryVo.getQueryTime());
/*  88 */     String partnerVerifyCode = Md5Encoder.encode(queryVo.getPartnerVerifyCode() + queryTime);
/*     */ 
/*  90 */     String queryXlm = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><AIPAYTRADE><INFO><SERVICE_TYPE>" + 
/*  93 */       queryVo.getServiceType() + "</SERVICE_TYPE>" + 
/*  94 */       "<CLIENT_IP>" + queryVo.getClientIp() + "</CLIENT_IP>" + 
/*  95 */       "<PARTNER_ID>" + queryVo.getPartnerId() + "</PARTNER_ID>" + 
/*  96 */       "<PARTNER_VERIFY_CODE>" + partnerVerifyCode + "</PARTNER_VERIFY_CODE>" + 
/*  97 */       "<REQUEST_TIME>" + requestTime + "</REQUEST_TIME>" + 
/*  98 */       "<SIGNED_MSG></SIGNED_MSG>" + 
/*  99 */       "</INFO>" + 
/* 100 */       "<BODY>" + 
/* 101 */       "<PARTNER_TRADE_NO>" + queryVo.getPartnerTradeNo() + "</PARTNER_TRADE_NO>" + 
/* 102 */       "<QUERY_TIME>" + queryTime + "</QUERY_TIME>" + 
/* 103 */       "<QUERY_REMARK>" + queryVo.getQueryRemark() + "</QUERY_REMARK>" + 
/* 104 */       "</BODY>" + 
/* 105 */       "</AIPAYTRADE>";
/*     */ 
/* 107 */     return queryXlm;
/*     */   }
/*     */ 
/*     */   protected String getRefundXml(RefundVo refundVo)
/*     */     throws Exception
/*     */   {
/* 116 */     SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/*     */ 
/* 118 */     String requestTime = df.format(refundVo.getRequestTime());
/* 119 */     String refundTime = df.format(refundVo.getRefundTime());
/* 120 */     String partnerVerifyCode = Md5Encoder.encode(refundVo.getPartnerVerifyCode() + refundTime);
/*     */ 
/* 122 */     String refundXlm = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><AIPAYTRADE><INFO><SERVICE_TYPE>" + 
/* 125 */       refundVo.getServiceType() + "</SERVICE_TYPE>" + 
/* 126 */       "<CLIENT_IP>" + refundVo.getClientIp() + "</CLIENT_IP>" + 
/* 127 */       "<PARTNER_ID>" + refundVo.getPartnerId() + "</PARTNER_ID>" + 
/* 128 */       "<PARTNER_VERIFY_CODE>" + partnerVerifyCode + "</PARTNER_VERIFY_CODE>" + 
/* 129 */       "<REQUEST_TIME>" + requestTime + "</REQUEST_TIME>" + 
/* 130 */       "<SIGNED_MSG></SIGNED_MSG>" + 
/* 131 */       "</INFO>" + 
/* 132 */       "<BODY>" + 
/* 133 */       "<PARTNER_TRADE_NO>" + refundVo.getPartnerTradeNo() + "</PARTNER_TRADE_NO>" + 
/* 134 */       "<REFUND_AMOUNT>" + refundVo.getRefundAmount() + "</REFUND_AMOUNT>" + 
/* 135 */       "<REFUND_TIME>" + refundTime + "</REFUND_TIME>" + 
/* 136 */       "<REFUND_NOTIFY_URL>" + refundVo.getRefundNotifyUrl() + "</REFUND_NOTIFY_URL>" + 
/* 137 */       "<REFUND_REMARK>" + refundVo.getRefundRemark() + "</REFUND_REMARK>" + 
/* 138 */       "</BODY>" + 
/* 139 */       "</AIPAYTRADE>";
/*     */ 
/* 141 */     return refundXlm;
/*     */   }
/*     */ 
/*     */   protected String getBindXml(BindVo bindVo)
/*     */     throws Exception
/*     */   {
/* 152 */     SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/*     */ 
/* 154 */     String requestTime = df.format(bindVo.getRequestTime());
/* 155 */     String partnerVerifyCode = Md5Encoder.encode(bindVo.getPartnerVerifyCode() + requestTime);
/*     */ 
/* 157 */     String bindXlm = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><AIPAYTRADE> <INFO> <SERVICE_TYPE>" + 
/* 160 */       bindVo.getServiceType() + "</SERVICE_TYPE>" + 
/* 161 */       "<CLIENT_IP>" + bindVo.getClientIp() + "</CLIENT_IP>" + 
/* 162 */       "<PARTNER_ID>" + bindVo.getPartnerId() + "</PARTNER_ID>" + 
/* 163 */       "<PARTNER_VERIFY_CODE>" + partnerVerifyCode + "</PARTNER_VERIFY_CODE>" + 
/* 164 */       "<REQUEST_TIME>" + requestTime + "</REQUEST_TIME>" + 
/* 165 */       "<SIGNED_MSG></SIGNED_MSG>" + 
/* 166 */       "</INFO>" + 
/* 167 */       "<BODY>" + 
/* 168 */       "<PARTNER_ACCT_ID>" + bindVo.getPartnerAcctId() + "</PARTNER_ACCT_ID>" + 
/* 169 */       "<PARTNER_ACCT_NAME>" + bindVo.getPartnerAcctName() + "</PARTNER_ACCT_NAME>" + 
/* 170 */       "<ACCT_RESERVED_FIELD1>" + bindVo.getAcctReservedField1() + "</ACCT_RESERVED_FIELD1>" + 
/* 171 */       "<ACCT_RESERVED_FIELD2>" + bindVo.getAcctReservedField2() + "</ACCT_RESERVED_FIELD2>" + 
/* 172 */       "<ACCT_RESERVED_FIELD3>" + bindVo.getAcctReservedField3() + "</ACCT_RESERVED_FIELD3>" + 
/* 173 */       "</BODY>" + 
/* 174 */       "</AIPAYTRADE>";
/*     */ 
/* 176 */     return bindXlm;
/*     */   }
/*     */ 
/*     */   protected String getPayNotifyResXml(SinglePayNotifyResVo notifyResVo)
/*     */   {
/* 187 */     SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/*     */ 
/* 189 */     String requestTime = df.format(notifyResVo.getRequestTime());
/* 190 */     String partnerVerifyCode = Md5Encoder.encode(notifyResVo.getPartnerVerifyCode() + requestTime);
/*     */ 
/* 192 */     String notifyResXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><AIPAYTRADE><INFO><PARTNER_ID>" + 
/* 195 */       notifyResVo.getPartnerId() + "</PARTNER_ID>" + 
/* 196 */       "<PARTNER_VERIFY_CODE>" + partnerVerifyCode + "</PARTNER_VERIFY_CODE>" + 
/* 197 */       "<REQUEST_TIME>" + df.format(notifyResVo.getRequestTime()) + "</REQUEST_TIME>" + 
/* 198 */       "<SIGNED_MSG></SIGNED_MSG>" + 
/* 199 */       "</INFO>" + 
/* 200 */       "<BODY>" + 
/* 201 */       "<TRADE_DETAILS>" + 
/* 202 */       "<TRANS_DETAIL>" + 
/* 203 */       "<TRADE_NO>" + notifyResVo.getTradeNo() + "</TRADE_NO>" + 
/* 204 */       "<PARTNER_TRADE_NO>" + notifyResVo.getPartnerTradeNo() + "</PARTNER_TRADE_NO>" + 
/* 205 */       "<RESULT_CODE>" + notifyResVo.getResultCode() + "</RESULT_CODE>" + 
/* 206 */       "</TRANS_DETAIL>" + 
/* 207 */       "</TRADE_DETAILS>" + 
/* 208 */       "</BODY>" + 
/* 209 */       "</AIPAYTRADE>";
/*     */ 
/* 211 */     return notifyResXml;
/*     */   }
/*     */ }

/* Location:           F:\hongpay_client.jar
 * Qualified Name:     cn.com.hongpay.client.gen.XmlGenerate
 * JD-Core Version:    0.6.0
 */